Lists II
There is another kind of function called a member function. These are functions which are called in relation to another object. For example, let's say you wanted to append an object x to a list L. There should be a function which takes a list and an object and returns the new list. However, taking a leaf from the book of Object Oriented Programming, this append function should be "attached" to a list. That is, L.Append(x) makes more sense and is easier to use then L = Append(L,x). This kind of function is called a member function. You use it as is shown in the example. Specifically, you call the function with the record operator with the major object (in this case the list) on the left side. The Append function returns the altered list for convienence, but you can ignore it.
Besides Append, there is its counterpart Prepend which places objects before a list. Both member functions take any number of parameters, all of which are appended or prepended in order. Another member function of a list is the Sort() function which sorts the elements in that list.
The next section in the Tutorial deals with threading, or running functions concurrently.
Web page maintained by Jason Cohen